#ifndef __ANYTIMER_H__
#define __ANYTIMER_H__

#define JOB_MAX 1024

typedef void (* at_jobfunc_t)(void *);

/*
 * 添加任务函数
 * return 
 * >= 0 ~success return ID
 * == -EINVAL ~argu is invalid
 * == -ENOSPC ~group is full
 * == -ENOMEM ~there is no room
 * */
int at_addjob(int sec, at_jobfunc_t jobp, void * arg);

/* 
 * 取消任务函数
 * return
 * == 0 ~success
 * == -EINVAL ~argu is invalid
 * == -EBUSY ~the job had been completed
 * == -ECANCELED ~the job double cancel
 * */
int at_canceljob(int id);

/* 
 * 回收任务函数
 * return
 * == 0 ~success
 * == -EINVAL ~argu is invalid
 * */
int at_waitjob(int id);


#endif